/*
-- =============================================
-- Author:			Jacqueline Walton
-- Create date:		December 17, 2013
-- Description:		Reset CT Database
-- Last Updated:	March 28, 2014

-- Summary:			This script will reset the Crystal Test database. 
					* Truncates the data in all Crystal Test tables. 
					* It will not delete or clear data in any test script or tables not included in the Crystal Test release. 
					* It only restores the basic data that was included at the time of release. 
					* Since clearing the DB does not automatically guarantee that test case IDs will be the same as previously, 
					  this script does not automatically rebuild the AutoTestCaseMap table. I recommend creating a copy of your 
					  AutoTestCaseMap data so you can remap child test cases.

					-- NOTE: After running this script...
						
					1. Run aspnet_regsql.exe (C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe)
					2. Stop all running servers
					3. Run the application
					4. On the Visual Studio menu (Project --> ASP.NET Configuration) take the application offline and then back online.
					   If you cant see this option, make sure you have a webpage selected and not a regular class.

-- License and Permissions
					 *     https://crystaltest.codeplex.com
					 *
					 * Distributed in whole under the terms of the Apache 2.0 License
					 *
					 *     Copyright 2014, Pixeltrix
					 *
					 * Licensed under the GNU General Public License version 2 (GPLv2) (the "License");
					 * you may not use this file except in compliance with the License.
					 * You may obtain a copy of the License at
					 * 
					 *     https://crystaltest.codeplex.com/license
					 * 
					 * Unless required by applicable law or agreed to in writing, software
					 * distributed under the License is distributed on an "AS IS" BASIS,
					 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
					 * See the License for the specific language governing permissions and
					 * limitations under the License.
					 *
					 *     Date: Fri Mar 28 2014 09:33:33 -0500
-- =============================================
*/

/*
=============================================
			 Clear Tables
=============================================
*/


/* Clear History */
TRUNCATE TABLE dbo.ReleaseTestCasesHistory
TRUNCATE TABLE dbo.GroupTestCasesHistory
TRUNCATE TABLE dbo.SprintTestCasesHistory
TRUNCATE TABLE dbo.TestResultsHistory
TRUNCATE TABLE dbo.TestCasesHistory

/* Clear Test Data */
TRUNCATE TABLE dbo.TestResultScreenshots
TRUNCATE TABLE dbo.TestCaseScreenshots
TRUNCATE TABLE dbo.TestCaseAssignments
TRUNCATE TABLE dbo.AutoTestCaseMap
TRUNCATE TABLE dbo.GroupTestCases
TRUNCATE TABLE dbo.ReleaseTestCases
TRUNCATE TABLE dbo.SprintTestCases
TRUNCATE TABLE dbo.TestResults

/* Clear Project Data */
TRUNCATE TABLE dbo.ProjectBrowserInfo
TRUNCATE TABLE dbo.ProjectEnvironmentInfo
DELETE FROM dbo.GroupTests
DELETE FROM dbo.Releases
DELETE FROM dbo.Sprints
DELETE FROM dbo.Environments

/* Clear Test Components */
TRUNCATE TABLE dbo.SeleniumServers
DELETE FROM dbo.TestTypes
DELETE FROM dbo.Browsers
DELETE FROM dbo.Statuses

/* Clear Test Case Data */
DELETE FROM dbo.TestCases

/* Clear Membership Data */
TRUNCATE TABLE dbo.aspnet_PersonalizationAllUsers
TRUNCATE TABLE dbo.aspnet_PersonalizationPerUser
TRUNCATE TABLE dbo.aspnet_SchemaVersions
TRUNCATE TABLE dbo.aspnet_WebEvent_Events
TRUNCATE TABLE dbo.aspnet_UsersInRoles
TRUNCATE TABLE dbo.aspnet_Profile
TRUNCATE TABLE dbo.UserProfiles
DELETE FROM dbo.aspnet_Membership
DELETE FROM dbo.aspnet_Users
DELETE FROM dbo.aspnet_Paths
DELETE FROM dbo.aspnet_Roles

/* Clear Company Data */
TRUNCATE TABLE dbo.CompanyInfo
DELETE FROM dbo.Projects


/*
=============================================
			 Reset SchemaVersions
=============================================
*/
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'common', N'1', 1)
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'health monitoring', N'1', 1)
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'membership', N'1', 1)
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'personalization', N'1', 1)
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'profile', N'1', 1)
INSERT [dbo].[aspnet_SchemaVersions] ([Feature], [CompatibleSchemaVersion], [IsCurrentVersion]) VALUES (N'role manager', N'1', 1)

/*
=============================================
			 Reset Company Data
=============================================
*/
INSERT [dbo].[CompanyInfo] ([CompanyName], [ctDocumentationURL], [ctProjectCreateBugURL], [ContactEmail]) VALUES (N'Example Company', N'https://crystaltest.codeplex.com/documentation', N'https://crystaltest.codeplex.com/workitem/list/basic', N'jacquelinewalton@testmanagementsystem.com')

/*
=============================================
			 Reset Roles
=============================================
*/

INSERT [dbo].[aspnet_Roles] ([ApplicationId], [RoleId], [RoleName], [LoweredRoleName], [Description]) VALUES (N'ffa0a609-c00c-4f98-b3cb-d7ab57c9b43c', N'38a97896-1967-4539-a258-0392157ebb40', N'Admin', N'admin', NULL)
INSERT [dbo].[aspnet_Roles] ([ApplicationId], [RoleId], [RoleName], [LoweredRoleName], [Description]) VALUES (N'ffa0a609-c00c-4f98-b3cb-d7ab57c9b43c', N'c2947a2a-4991-4247-b629-b26ff6b2102e', N'External Tester', N'external tester', NULL)
INSERT [dbo].[aspnet_Roles] ([ApplicationId], [RoleId], [RoleName], [LoweredRoleName], [Description]) VALUES (N'ffa0a609-c00c-4f98-b3cb-d7ab57c9b43c', N'12eef8b0-921b-4a86-85ce-b41ca0936726', N'Tester', N'tester', NULL)

/*
=============================================
		 Install Test Types
=============================================
*/

INSERT [dbo].[TestTypes] ([testType]) VALUES (N'Automated')
INSERT [dbo].[TestTypes] ([testType]) VALUES (N'Automated Child')
INSERT [dbo].[TestTypes] ([testType]) VALUES (N'Manual')

/*
=============================================
			 Reset Projects
=============================================
*/

INSERT [dbo].[Projects] ([projectAbbreviation], [projectName]) VALUES (N'EXAMPLE', N'Example Project')
INSERT [dbo].[Projects] ([projectAbbreviation], [projectName]) VALUES (N'CT', N'Crystal Test')

/*
=============================================
			 Reset Environments
=============================================
*/

INSERT [dbo].[Environments] ([environment], [sortOrder]) VALUES (N'Local', 1)
INSERT [dbo].[Environments] ([environment], [sortOrder]) VALUES (N'QA', 2)
INSERT [dbo].[Environments] ([environment], [sortOrder]) VALUES (N'Stage', 3)
INSERT [dbo].[Environments] ([environment], [sortOrder]) VALUES (N'Production', 4)

/*
=============================================
			 Reset Statuses
=============================================
*/

INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'Fail', 0)
INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'Pass', 1)
INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'Not Started', 2)
INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'Retest', 3)
INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'In Progress', 4)
INSERT [dbo].[Statuses] ([status], [PriorityRank]) VALUES (N'In Queue', 5)

/*
=============================================
        	 Install Browsers
=============================================
*/

INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'CHROME', N'Chrome', NULL, NULL, 1, 1, 1, 1)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'FF', N'Firefox', NULL, NULL, 2, 1, 1, 1)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'IE10', N'IE 10', NULL, NULL, 5, NULL, 1, 0)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'IE11', N'IE 11', NULL, NULL, 6, NULL, NULL, 0)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'IE8', N'IE 8', NULL, NULL, 3, NULL, NULL, 0)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'IE9', N'IE 9', NULL, NULL, 4, 1, NULL, 1)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'MACSAF', N'Macintosh Safari', NULL, NULL, 7, NULL, NULL, 0)
INSERT [dbo].[Browsers] ([browserAbbreviation], [browserName], [browserServer], [browserIP], [DisplayColumnNumber], [browserSupportedByAutomation], [browserSupportedByAnalytics], [showBrowserColumn]) VALUES (N'WINSAF', N'Windows Safari', NULL, NULL, 8, NULL, NULL, 0)

/*
=============================================
		 Install Selenium Servers
=============================================
*/

SET IDENTITY_INSERT [dbo].[SeleniumServers] ON 
INSERT [dbo].[SeleniumServers] ([SeleniumServerID], [ServerName], [ServerIp], [ServerPort], [ServerEnvironment], [ServerRole], [OperatingSystem], [Browsers]) VALUES (1, N'localhost', NULL, NULL, N'LOCAL', N'HUB', N'Windows 7', NULL)
INSERT [dbo].[SeleniumServers] ([SeleniumServerID], [ServerName], [ServerIp], [ServerPort], [ServerEnvironment], [ServerRole], [OperatingSystem], [Browsers]) VALUES (2, N'localhost', NULL, NULL, N'LOCAL', N'Node', N'Windows 7', N'CHROME|FF|IE9')
INSERT [dbo].[SeleniumServers] ([SeleniumServerID], [ServerName], [ServerIp], [ServerPort], [ServerEnvironment], [ServerRole], [OperatingSystem], [Browsers]) VALUES (3, N'localhost', NULL, NULL, N'LOCAL', N'AutomationTestEngine', N'Windows 7', NULL)
SET IDENTITY_INSERT [dbo].[SeleniumServers] OFF

/*
=============================================
			 Install Groups
=============================================
*/
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADDMANUALRESULTS', N'Page - Insert Test Result', N'Test cases relating to the Insert Manual Result page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADDNEWTC', N'Page - Add New Test Case', N'Test cases relating to the Add New Test Case page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINGROUPS', N'Page - Administer Groups', N'Test cases relating to the Administer Groups page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINPROJECTS', N'Page - Administer Projects', N'Test cases relating to the Administer Projects page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINRELEASES', N'Page - Administer Releases', N'Test cases relating to Administer Releases page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINBROWSERS', N'Page - Administer Browsers', N'Test cases relating to Administer Browsers page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINENVIRONMENTS', N'Page - Administer Environments', N'Test cases relating to Administer Environments page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINSELENIUM', N'Page - Administer Selenium', N'Test cases relating to the Administer Selenium page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINSPRINTS', N'Page - Administer Sprints', N'Test cases relating to the Administer Sprints page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'ADMINTESTCASES', N'Page - Administer Test Cases', N'Test cases relating to the Administer Test Cases page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'AUTHENTICATION', N'Authentication', N'Test cases relating to authentication.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'AUTHORIZATION', N'Authorization', N'Test cases relating to authorization.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'DASHBOARD', N'Page - Dashboard', N'Test cases relating to the Dashboard page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'DEFECTS', N'Defects', N'Test cases relating to defect management.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'EDITTESTRESULT', N'Page - Edit Test Result', N'Test cases relating to the Edit Test Result page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'FOOTER', N'Footer', N'Test cases relating to the footer.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'FUNCTIONAL', N'Page - Functional Testing', N'Test cases relating to the Functional Testing page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'HEADER', N'Header', N'Test cases relating to the header.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'PROFILE', N'Page - Profile', N'Test Cases relating to the Profile page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'REG', N'* Regression Test', N'Test cases executed during a regression test.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'REGISTRATION', N'Page - Registration', N'Test cases relating to the registration page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'RESULTHISTORY', N'Page - Result History', N'Test cases relating to the Result History page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'SMOKE', N'* Smoke Test', N'Test cases executed during a smoke test.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'TABMENU', N'Tab Menu', N'Test cases relating to the Tab Menu in the header.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'TESTCASEDETAILS', N'Page - Test Case Details', N'Test cases relating to the Test Case Details page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'UPDATEHISTORY', N'Page - Update History', N'Test cases relating to the Update History page.', NULL)
INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'CT', N'UPDATETESTCASE', N'Page - Update Test Case', N'Test cases relating to the Update Test Case page.', NULL)

INSERT [dbo].[GroupTests] ([projectAbbreviation], [groupTestAbbreviation], [groupTestName], [groupTestDescription], [personalGroupOwner]) VALUES (N'EXAMPLE', N'AUTH', N'Authorization', N'Test cases relating to Gmail authorization.', NULL)

/*
=============================================
			 Install Releases
=============================================
*/
INSERT [dbo].[Releases] ([projectAbbreviation], [release], [releaseDescription], [releaseDate]) VALUES (N'EXAMPLE', N'Example Release', N'This is an example release', GETDATE() + 30)

/*
=============================================
			 Install Sprints
=============================================
*/
INSERT [dbo].[Sprints]([projectAbbreviation], [sprint], [sprintDescription], [sprintStartDate], [sprintEndDate]) VALUES (N'EXAMPLE', N'Example Sprint', N'This is an example sprint', GETDATE(), GETDATE() + 30 )

/*
=============================================
		 Install Test Cases
=============================================
*/
INSERT [dbo].[TestCases] ([projectAbbreviation], [testCaseId], [testCaseDescription], [active], [testCaseOutdated], [testScriptOutdated], [testCaseSteps], [expectedResults], [testCaseNotes], [dateLastUpdated], [updatedBy], [autoTestClass], [autoMetaDataTable], [autoMetaDataRow], [dateCreated], [createdBy], [dateAutomatedTestCreated], [automatedTestCreatedBy], [testCategory], [automated], [reasonForNotAutomated]) VALUES (N'EXAMPLE', 1, N'Verify a user can log into their Gmail account regardless of whether they have previously logged in or not.', 1, 0, 0, N'For automation example purposes only<br>', N'For automation example purposes only', N'For automation example purposes only', GETDATE(), N'', NULL, NULL, NULL, GETDATE(), N'', NULL, NULL, N'Functional', NULL, NULL)

/*
=============================================
Assign Test Cases to Groups
=============================================
*/
INSERT [dbo].[GroupTestCases] ([projectAbbreviation], [testCaseId], [groupTestAbbreviation]) VALUES (N'EXAMPLE', 1, N'AUTH')

/*
=============================================
Assign Test Case to Release
=============================================
*/
INSERT [dbo].[ReleaseTestCases]([projectAbbreviation], [testCaseId], [release]) VALUES (N'EXAMPLE', 1, N'Example Release')


/*
=============================================
Assign Test Case to Sprint
=============================================
*/
INSERT [dbo].[SprintTestCases]([projectAbbreviation], [testCaseId], [sprint]) VALUES (N'EXAMPLE', 1, N'Example Sprint')

/*
=============================================
	   Reset Project Browser Info
=============================================
*/
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'CHROME', 1)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'FF', 1)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'IE10', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'IE11', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'IE8', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'IE9', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'MACSAF', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'EXAMPLE', N'WINSAF', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'CHROME', 1)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'FF', 1)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'IE10', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'IE11', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'IE8', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'IE9', 1)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'MACSAF', 0)
INSERT [dbo].[ProjectBrowserInfo] ([projectAbbreviation], [browserAbbreviation], [showBrowserColumn]) VALUES (N'CT', N'WINSAF', 0)

/*
=============================================
	 Install Project Environment Info
=============================================
*/

INSERT [dbo].[ProjectEnvironmentInfo] ([projectAbbreviation], [environment], [baseURL], [baseAdminURL], [defaultEnvironment]) VALUES (N'EXAMPLE', N'QA', N'http://accounts.google.com', NULL, 1)
INSERT [dbo].[ProjectEnvironmentInfo] ([projectAbbreviation], [environment], [baseURL], [baseAdminURL], [defaultEnvironment]) VALUES (N'CT', N'Local', N'http://localhost:13337', N'http://localhost:13337/Admin/', 1)
INSERT [dbo].[ProjectEnvironmentInfo] ([projectAbbreviation], [environment], [baseURL], [baseAdminURL], [defaultEnvironment]) VALUES (N'CT', N'QA', N'http://localhost:13337', 'http://localhost:13337/Admin/', 0)

/*
=============================================
 Create Example Metadata Table
=============================================
*/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_Examples_Login]') AND type in (N'U'))
DROP TABLE [dbo].[_Examples_Login]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_Examples_Login]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[_Examples_Login](
	[LoginID] [int] IDENTITY(1,1) NOT NULL,
	[Description] [varchar](150) NULL,
	[Email] [varchar](100) NULL,
	[Password] [varchar](50) NULL,
	[isFacebook] [bit] NULL
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO

/*
=============================================
 Install Example Automation MetaData
=============================================
*/
SET IDENTITY_INSERT [dbo].[_Examples_Login] ON 
INSERT [dbo].[_Examples_Login] ([LoginID], [Description], [Email], [Password], [isFacebook]) VALUES (1, N'OSTMS Test User', N'ostms.testuser@gmail.com', N't3stus3r', NULL)
SET IDENTITY_INSERT [dbo].[_Examples_Login] OFF

/*
=============================================
 Install Example Automated Script
=============================================
*/
UPDATE testcases SET autoTestClass = 'Example_TestScripts.Example_Login, Example_TestScripts', autoMetaDataTable = '_Examples_Login', autoMetaDataRow = 1, automated = 'Yes', automatedTestCreatedBy = null, dateAutomatedTestCreated = GETDATE() WHERE testcaseid = 1 and projectAbbreviation = 'EXAMPLE'
